@extends('_layouts.blank')

@section('page-level-styles')
{{ HTML::style('assets/global/plugins/select2/select2.css') }}
{{ HTML::style('assets/global/plugins/data-tables/DT_bootstrap.css') }}
{{ HTML::style('assets/global/plugins/bootstrap-datepicker/css/datepicker.css') }}
{{ HTML::style('assets/global/plugins/bootstrap-fileinput/bootstrap-fileinput.css') }}
{{ HTML::style('assets/global/plugins/bootstrap-modal/css/bootstrap-modal-bs3patch.css') }}
{{ HTML::style('assets/global/plugins/bootstrap-modal/css/bootstrap-modal.css') }}
@stop

@section('page-level-plugins')
{{ HTML::script('assets/global/plugins/jquery-validation/js/jquery.validate.min.js') }}
{{ HTML::script('assets/global/plugins/jquery-validation/js/additional-methods.min.js') }}
{{ HTML::script('assets/global/plugins/select2/select2.min.js') }}
{{ HTML::script('assets/global/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js') }}
{{ HTML::script('assets/global/plugins/bootstrap-datepicker/js/bootstrap-datepicker.vi.js') }}
{{ HTML::script('assets/global/plugins/bootstrap-fileinput/bootstrap-fileinput.js') }}
{{ HTML::script('assets/global/plugins/jquery-file-upload/js/vendor/tmpl.min.js') }}
{{ HTML::script('assets/global/plugins/jquery-file-upload/js/vendor/jquery.ui.widget.js') }}
{{ HTML::script('assets/global/plugins/jquery-file-upload/js/jquery.iframe-transport.js') }}
{{ HTML::script('assets/global/plugins/jquery-file-upload/js/jquery.fileupload.js') }}
{{ HTML::script('assets/global/plugins/data-tables/jquery.dataTables.js') }}
{{ HTML::script('assets/global/plugins/data-tables/DT_bootstrap.js') }}
{{ HTML::script('assets/global/plugins/bootstrap-modal/js/bootstrap-modalmanager.js') }}
{{ HTML::script('assets/global/plugins/bootstrap-modal/js/bootstrap-modal.js') }}
@stop

@section('page-level-script')
{{ HTML::script('assets/global/scripts/datatable.js') }}
{{ HTML::script('assets/global/scripts/datatable.vi.js') }}
{{ HTML::script('assets/admin/pages/scripts/user-create.js') }}
@stop

@section('jquery-document-ready')
UserCreate.init();
@stop

@section('breadcrumb-button')
<li class="btn-group">
    <button class="btn green" id="btn-new"><i class="fa fa-bookmark"></i> {{ $iCourse }}</button>
</li>
@stop

@section('page-content')
<div id="ajax-modal" class="modal container fade" tabindex="-1"></div>
<input type="hidden" class="error-no-action" value="{{ trans('user-pages.list.message.error-no-action') }}"/>
<input type="hidden" class="error-no-item" value="{{ trans('user-pages.list.message.error-no-item') }}"/>
<div class="row">
    <div class="col-md-12">
        <div class="tabbable tabbable-custom tabbable-reversed">
            <ul class="nav nav-tabs">
                <li>
                    <a href="#tab_1" data-toggle="tab">
                        {{ trans('user-pages.create.single-create') }}
                    </a>
                </li>
                <li class="active">
                    <a href="#tab_2" data-toggle="tab">
                        {{ trans('user-pages.create.multi-create') }}
                    </a>
                </li>
            </ul>
            <div class="tab-content">
                <div class="tab-pane" id="tab_1">
                    <div class="portlet-body form">
                        <!-- BEGIN FORM-->
                        <form action="" method="post" class="form-horizontal" id="form-profile">
                            <div class="form-body">
                                <div class="alert alert-danger display-hide">
                                    <button class="close" data-close="alert"></button>
                                    {{ trans('validation.custom.error-title') }}
                                </div>
                                <div class="alert alert-success display-hide">
                                    <button class="close" data-close="alert"></button>
                                    {{ trans('validation.custom.success-title') }}
                                </div>
                                <h3 class="form-section">{{ trans('user-pages.create.person-info') }}</h3>
                                <div class="row">
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label class="control-label col-md-4" for="saint">{{ trans('user.saint') }}</label>
                                            <div class="col-md-8">
                                                <input type="text" name="saint" id="saint" class="form-control">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label class="control-label col-md-4" for="username">{{ trans('user.username') }} <span class="required">*</span></label>
                                            <div class="col-md-8">
                                                <input type="text" class="form-control" name="username" id="username">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label class="control-label col-md-4" for="password">{{ trans('user.password') }} <span class="required">*</span></label>
                                            <div class="col-md-8">
                                                <input type="password" class="form-control" name="password" id="password">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label class="control-label col-md-4" for="retype_password">{{ trans('user.retype-password') }} <span class="required">*</span></label>
                                            <div class="col-md-8">
                                                <input type="password" class="form-control" name="retype_password" id="retype_password">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <!--/row-->
                                <div class="row">
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label class="control-label col-md-4" for="gender">{{ trans('user.gender-name') }}</label>
                                            <div class="col-md-8">
                                                <select class="form-control" name="gender" id="gender">
                                                    @foreach ( trans('user.gender') as $key => $value)
                                                    <option value="{{ $key }}">{{ $value }}</option>
                                                    @endforeach
                                                </select>
                                            </div>
                                        </div>
                                    </div>
                                    <!--/span-->
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label class="control-label col-md-4" for="birthday">{{ trans('user.birthday') }} <span class="required">*</span></label>
                                            <div class="col-md-8">
                                                <div class="input-group date date-picker" data-date-format="dd-mm-yyyy">
                                                    <input type="text" class="form-control" id="birthday" readonly name="birthday">
                                                    <span class="input-group-btn">
                                                        <button class="btn" type="button"><i class="fa fa-calendar"></i></button>
                                                    </span>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <!--/span-->
                                </div>
                                <!--/row-->
                                <div class="row">
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label class="control-label col-md-4" for="usertype">{{ trans('user.usertype') }}</label>
                                            <div class="col-md-8">
                                                <select class="form-control" name="usertype" id="usertype">
                                                    @foreach($Options['USERTYPE'] as $sKey => $sValue)
                                                    <option value="{{ $sValue->key }}">{{ $sValue->data }}</option>
                                                    @endforeach
                                                </select>
                                            </div>
                                        </div>
                                    </div>
                                    <!--/span-->
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label class="control-label col-md-4" for="usercrew">{{ trans('user.usercrew') }}</label>
                                            <div class="col-md-8">
                                                <select class="form-control" name="usercrew" id="usercrew">
                                                    <option value=""></option>
                                                    @foreach($Options['USERCREW'] as $sKey => $sValue)
                                                    <option value="{{ $sValue->key }}">{{ $sValue->data }}</option>
                                                    @endforeach
                                                </select>
                                            </div>
                                        </div>
                                    </div>
                                    <!--/span-->
                                </div>
                                <!--/row-->
                                <div class="row">
                                    <!--/span-->
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label class="control-label col-md-4" for="team">{{ trans('user.class') }}</label>
                                            <div class="col-md-8">
                                                <select name="class_id" id="class_id" class="form-control">
                                                    <option></option>
                                                    @foreach ($Classes as $oClasses )
                                                    <option value="{{ $oClasses->id }}">{{ $oClasses->generateClassName(true) }}</option>
                                                    @endforeach
                                                </select>
                                            </div>
                                        </div>
                                    </div>
                                    <!--/span-->
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label class="control-label col-md-4" for="baptism_date">{{ trans('user.baptism-date') }}</label>
                                            <div class="col-md-8">
                                                <div class="input-group date date-picker" data-date-format="dd-mm-yyyy">
                                                    <input type="text" class="form-control" id="baptism_date" readonly name="baptism_date">
                                                    <span class="input-group-btn">
                                                        <button class="btn" type="button"><i class="fa fa-calendar"></i></button>
                                                    </span>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <!--/span-->
                                </div>
                                <!--/row-->
                                <div class="row">
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label class="control-label col-md-4" for="eucharist_date">{{ trans('user.eucharist-date') }}</label>
                                            <div class="col-md-8">
                                                <div class="input-group date date-picker" data-date-format="dd-mm-yyyy">
                                                    <input type="text" class="form-control" id="eucharist_date" readonly name="eucharist_date">
                                                    <span class="input-group-btn">
                                                        <button class="btn" type="button"><i class="fa fa-calendar"></i></button>
                                                    </span>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <!--/span-->
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label class="control-label col-md-4" for="confirmation_date">{{ trans('user.confirmation-date') }}</label>
                                            <div class="col-md-8">
                                                <div class="input-group date date-picker" data-date-format="dd-mm-yyyy">
                                                    <input type="text" class="form-control" id="confirmation_date" readonly name="confirmation_date">
                                                    <span class="input-group-btn">
                                                        <button class="btn" type="button"><i class="fa fa-calendar"></i></button>
                                                    </span>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <!--/row-->
                                <div class="row">
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label class="control-label col-md-4" for="parish">{{ trans('user.parish') }}</label>
                                            <div class="col-md-8">
                                                <input type="text" class="form-control" id="parish" name="parish">
                                            </div>
                                        </div>
                                    </div>
                                    <!--/span-->
                                </div>
                                <!--/row-->
                                <h3 class="form-section">{{ trans('user-pages.create.contact') }}</h3>
                                <div class="row">
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label class="control-label col-md-4" for="email">{{ trans('user.email') }}</label>
                                            <div class="col-md-8">
                                                <input type="text" name="email" id="email" class="form-control">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label class="control-label col-md-4" for="phone">{{ trans('user.phone') }}</label>
                                            <div class="col-md-8">
                                                <input type="text" name="phone" id="phone" class="form-control">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <!--/row-->
                                <div class="row">
                                    <div class="col-md-12">
                                        <div class="form-group">
                                            <label class="control-label col-md-2" for="address">{{ trans('user.address') }}</label>
                                            <div class="col-md-10">
                                                <input type="text" name="address" id="address" class="form-control">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <!--/row-->
                                <h3 class="form-section">{{ trans('dear.dear-title') }}</h3>
                                <div class="row">
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label class="control-label col-md-4" for="dearsaint">{{ trans('user.saint') }}</label>
                                            <div class="col-md-8">
                                                <input type="text" name="dearsaint" id="dearsaint" class="form-control">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label class="control-label col-md-4" for="dearname">{{ trans('user.username') }}</label>
                                            <div class="col-md-8">
                                                <input type="text" name="dearname" id="dearname" class="form-control">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label class="control-label col-md-4" for="relationship">{{ trans('options-pages.relationship_option') }}</label>
                                            <div class="col-md-8">
                                                <select name="relationship" id="relationship" class="form-control">
                                                    <option></option>
                                                    @foreach($Options['RELATIONSHIP'] as $sKey => $sValue)
                                                    <option value="{{ $sValue->key }}">{{ $sValue->data }}</option>
                                                    @endforeach
                                                </select>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label class="control-label col-md-4" for="dearphone">{{ trans('user.phone') }}</label>
                                            <div class="col-md-8">
                                                <input type="text" name="dearphone" id="dearphone" class="form-control">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <!--/row-->
                                <div class="row">
                                    <div class="col-md-12">
                                        <div class="form-group">
                                            <label class="control-label col-md-2" for="dearaddress">{{ trans('user.address') }}</label>
                                            <div class="col-md-10">
                                                <input type="text" name="dearaddress" id="dearaddress" class="form-control">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <!--/row-->
                            </div>
                            <div class="form-actions fluid">
                                <div class="row">
                                    <div class="col-md-6">
                                        <div class="col-md-offset-3 col-md-8">
                                            <button type="submit" class="btn green">{{ trans('system.button.submit') }}</button>
                                        </div>
                                    </div>
                                    <div class="col-md-6">
                                    </div>
                                </div>
                            </div>
                        </form>
                        <!-- END FORM-->
                    </div>
                </div>
                <div class="tab-pane active" id="tab_2">
                    <div class="portlet-body form">
                        <!-- BEGIN FORM-->
                        <form action="{{route('create-user-by-file')}}" method="post" class="form-horizontal" id="form-file">
                            <div class="form-body">
                                <div class="alert alert-danger display-hide">
                                    <button class="close" data-close="alert"></button>
                                    {{ trans('validation.custom.error-title') }}
                                </div>
                                <div class="alert alert-success display-hide">
                                    <button class="close" data-close="alert"></button>
                                    {{ trans('validation.custom.success-title') }}
                                </div>
                                <div class="row file-row">
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label class="control-label col-md-4">{{ trans('user-pages.create.template') }}</label>
                                            <div class="col-md-8">
                                                <a href="{{url('packages/DanhSach_HuynTruong.xls')}}" class="btn blue">
                                                    <i class="fa fa-cloud-download"></i>
                                                    {{ trans('system.button.download')}}
                                                </a>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="row file-row">
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label class="control-label col-md-4" for="usertype">{{ trans('user.usertype') }} <span class="required">*</span></label>
                                            <div class="col-md-8">
                                                <select class="form-control" name="usertype" id="usertype">
                                                    <option></option>
                                                    @foreach($Options['USERTYPE'] as $sKey => $sValue)
                                                    <option value="{{ $sValue->key }}">{{ $sValue->data }}</option>
                                                    @endforeach
                                                </select>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <!--/row-->
                                <div class="row">
                                    <div class="col-md-12">
                                        <div class="form-group">
                                            <label class="control-label col-md-2" for="file">File <span class="required">*</span></label>
                                            <div class="col-md-10">
                                                <div class="fileinput fileinput-new" data-provides="fileinput">
                                                    <span class="btn default btn-file">
                                                        <span class="fileinput-new">
                                                            {{trans('system.select')}}
                                                        </span>
                                                        <span class="fileinput-exists">
                                                            {{trans('system.change')}}
                                                        </span>
                                                        <input type="file" name="file" id="file">
                                                    </span>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <!--/row-->
                            </div>
                        </form>
                        <!-- END FORM-->
                        <div class="row row-table display-hide">
                            <div class="col-md-12">
                                <div class="table-container">
                                    <div class="table-actions-wrapper">
                                        <span></span>
                                        <select class="table-group-action-input form-control input-inline input-small input-sm">
                                            <option value="">{{ trans('system.select') }}...</option>
                                            <option value="new">{{ trans('system.button.new') }}</option>
                                            <option value="delete">{{ trans('system.button.delete') }}</option>
                                        </select>
                                        <button class="btn btn-sm blue table-group-action-submit"><i class="fa fa-check"></i> {{ trans('system.button.submit') }}</button>
                                    </div>
                                    <table class="table table-striped table-bordered table-hover" id="datatable_list" action="{{ route('create-user-by-file-table',['cacheID'=>'']) }}">
                                        <thead>
                                            <tr role="row" class="heading">
                                                <th width="1%">
                                                    <input type="checkbox" class="group-checkable">
                                                </th>
                                                <th>
                                                    {{ trans('system.actions') }}
                                                </th>
                                                <th>
                                                    {{ trans('user.saint') }}
                                                </th>
                                                <th>
                                                    {{ trans('user.username') }}
                                                </th>
                                                <th>
                                                    {{ trans('user.birthday') }}
                                                </th>
                                                <th>
                                                    {{ trans('user.gender-name') }}
                                                </th>
                                                <th>
                                                    {{ trans('user.class') }}
                                                </th>
                                                <th>
                                                    {{ trans('user.phone') }}
                                                </th>
                                                <th>
                                                    {{ trans('user.address') }}
                                                </th>
                                                <th>
                                                    {{ trans('user.parish') }}
                                                </th>
                                                <th>
                                                    {{ trans('user.baptism-date') }}
                                                </th>
                                                <th>
                                                    {{ trans('user.eucharist-date') }}
                                                </th>
                                                <th>
                                                    {{ trans('user.confirmation-date') }}
                                                </th>
                                                <th>
                                                    {{ trans('user.saint') }} {{ @$Options['RELATIONSHIP']['CHA']->data }}
                                                </th>
                                                <th>
                                                    {{ trans('user.username') }} {{ @$Options['RELATIONSHIP']['CHA']->data }}
                                                </th>
                                                <th>
                                                    {{ trans('user.saint') }} {{ @$Options['RELATIONSHIP']['ME']->data }}
                                                </th>
                                                <th>
                                                    {{ trans('user.username') }} {{ @$Options['RELATIONSHIP']['ME']->data }}
                                                </th>
                                            </tr>
                                        </thead>
                                        <tbody></tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
@stop